import pandas as pd

pd.set_option('display.max_columns', 1000)
pd.set_option('display.width', 1000)  # 设置宽度,就是说不换行,比较好看数据
pd.set_option('display.max_rows', 500)  # 设置行数的多少

df = pd.read_csv("C:\\Users\\ljc\\Downloads\\最近的查询 2024-04-19T09_34_56.793+08_00.csv")

df = df[df['开始时间'] < '2024-04-19']

df = df['数据已扫描']

sum = 0.0

for row in df:
    r = str(row)
    num = float(r.split(' ')[0])
    unit = r.split(' ')[1]
    if 'KB' in unit:
        num = num / 1024/1024
    elif 'MB' in unit:
        num = num / 1024
    elif 'GB' in unit:
        num = num

    sum += num

print(sum)

# print(df)
